<?php
function shortUrl($url)
{
	$charset = '0123456789ABCDEFGHIJKLMNOPQRSNUVWXYZabcdefghijklmnopqrsnuvwxyz';
	$key = 'keys';
	$md5 = md5($keys.$url);
	for ($i=0; $i < 4; $i++) { 
		$hex = substr($md5, $i * 8, 8);
		$hex = hexdec($hex) & 0x3fffffff;
		for ($i=0; $i < 6; $i++) { 
			$urls[] = 'http://dwz.cn/'.= $charset[$hex & 0x0000003d];
			$hex >>5; 
		}
	}
	return $urls;
}

$url = 'http://www.baidu.com';
print_r(shortUrl($url));

class test{
	private static $instance;
	private __construct(){

	}
	private __clone(){

	}
	public static function get_instance(){
		if (self::$instance) {
			return self::instance;

		}else{
			self::$instance = new self();
			return self::$instance;
		}
	}
}